#include "reg52.h"
//数据类型重定义
typedef unsigned int uint16;
typedef unsigned char uint8;
//变量定义
uint8 code LED[8] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f };
//函数声明
void Delay_Nms(uint16 n); // 声明延时 N ms 函数

void main() {
	uint8 i;
	while (1) {
		for (i = 0; i < 8; i++) {
			P2 = LED[i];
			Delay_Nms(1000);
		}
	}
}

void Delay_Nms(uint16 n) {
	uint16 i;
	uint16 j;
	for (i = 0; i < n; i++) {
		for (j = 0; j < 1000; j++) {
		}
	}
}